home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 103
/
XENIATGM103.iso
/
Shareware
/
GoLive 5.0
/
MM7.Cab
/
F1438_DragFloatingBox.action.F6A680DD_F3FB_4CF3_BABB_0D0F06E630F5
< prev
next >
Wrap
Text File
|
2000-08-17
|
5KB
|
142 lines
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Drag Floating Box Action</title>
<meta name="generator" content="Adobe GoLive 5">
</head>
<body bgcolor="white">
<center>
<font size="6">Drag Floating Box Action</font>
<hr>
</center>
<csactionclass name="Drag Floating Box" function="CSDrag" nsversion="4" ieversion="4">
<csactionparam name="layer" type="GLActionLayerParam"></csactionparam>
</csactionclass>
<p>IE Functions Script
<script language="JavaScript1.2" src="../../GlobalScripts/IE.scpt" cyberversion="N1.2"></script>
</p>
<p>Drag Action Main Script
<script language="JavaScript1.2" cyberversion="N1.2"><!--
var gCSIEDragObject = null;
function CSSetupDrag (layerName) {
this.x = 0; this.y = 0;
if (IsIE()) {
this.canDrag=true;
this.layerObj=document.all.tags("div")[layerName];
this.layerObj.dragObj = this;
document.ondragstart = CSIEStartDrag;
document.onmousedown = CSIEMouseDown;
document.onmouseup = CSIEStopDrag;
} else {
this.layer=CSNSStyl(layerName);this.onmousemove=null;
this.layer.document.theLayer=this;
this.layer.document.captureEvents(Event.MOUSEDOWN);
this.layer.document.onmousedown=CSNSStartDrag;
this.layer.document.onmouseup=CSNSStopDrag;
}
}
function CSNSStartDrag (ev) {
var clickInMe = false;
if (ev.target != this) {
for (var i=0;i<this.images.length;i++) {
if (this.images[i] == ev.target) { clickInMe = true; break;}
}
}
else clickInMe = true;
if (clickInMe)
{
this.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
this.onmousemove=CSNSDoDrag;
this.theLayer.x= ev.pageX;
this.theLayer.y= ev.pageY;
this.routeEvent(ev);
return false;
}
this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
this.routeEvent(ev);
return true;
}
function CSNSStopDrag (ev) {
this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);return false;
}
function CSNSDoDrag (ev) {
this.theLayer.layer.moveBy(ev.pageX-this.theLayer.x, ev.pageY-this.theLayer.y);
this.theLayer.x = ev.pageX;
this.theLayer.y = ev.pageY;
this.routeEvent(ev);
}
function CSIEStartDrag () {
if(gCSIEDragObject != null && (gCSIEDragObject.tagName==event.srcElement.tagName))
event.returnValue=false;
}
function CSIEStopDrag () { gCSIEDragObject=null; document.onmousemove=null; }
function CSIEMouseDown () {
if(event.button==1) {
dragLayer = event.srcElement;
while (dragLayer!=null)
{
if ((dragLayer.dragObj == null) && (dragLayer.tagName == "DIV"))
break;
if (dragLayer.dragObj != null)
break;
dragLayer=dragLayer.parentElement;
}
if (dragLayer == null) return;
if (dragLayer.dragObj!=null && dragLayer.dragObj.canDrag) {
gCSIEDragObject = dragLayer;
gCSIEDragObject.dragObj.x=event.clientX;
gCSIEDragObject.dragObj.y=event.clientY;
document.onmousemove = CSIEMouseMove;
}
}
}
function CSIEMouseMove () {
gCSIEDragObject.dragObj.layerObj.style.pixelLeft+=(event.clientX-gCSIEDragObject.dragObj.x);
gCSIEDragObject.dragObj.layerObj.style.pixelTop+=(event.clientY-gCSIEDragObject.dragObj.y);
gCSIEDragObject.dragObj.x=event.clientX;
gCSIEDragObject.dragObj.y=event.clientY;
event.returnValue = false;
event.cancelBubble = true;
}
var gDragArray = new Array();
function CSDrag(action) { gDragArray[gDragArray.length] = new CSSetupDrag(action[1]); }
// -->
</script>
</p>
<table cool width="221" height="153" border="0" cellpadding="0" cellspacing="0" gridx="16" showgridx gridy="16" showgridy bgcolor="#eeeeee">
<tr height="1" cntrlrow>
<td width="1" height="1"><spacer type="block" width="1" height="1"></td>
<td width="4" height="1"><spacer type="block" width="4" height="1"></td>
<td width="76" height="1"><spacer type="block" width="76" height="1"></td>
<td width="140" height="1"><spacer type="block" width="140" height="1"></td>
</tr>
<tr height="6">
<td width="1" height="6"><spacer type="block" width="1" height="6"></td>
<td width="4" height="6"><spacer type="block" width="4" height="6"></td>
<td width="76" height="6"><spacer type="block" width="76" height="6"></td>
<td width="140" height="6"><spacer type="block" width="140" height="6"></td>
</tr>
<tr height="3">
<td width="1" height="3"><spacer type="block" width="1" height="3"></td>
<td width="4" height="3"><spacer type="block" width="4" height="3"></td>
<td width="76" height="3"><spacer type="block" width="76" height="3"></td>
<td width="140" height="146" colspan="1" rowspan="2" valign="top" align="left" xpos="80">
<csactioncntrl name="layer" x="80" y="6" width="136" height="18" alignx="scale" aligny="top">
</td>
</tr>
<tr height="143">
<td width="1" height="143"><spacer type="block" width="1" height="143"></td>
<td width="4" height="143"><spacer type="block" width="4" height="143"></td>
<td width="76" height="143" colspan="1" rowspan="1" valign="top" align="left" xpos="4">
<csactioncntrl type="InfoText" value="Floating Box" x="4" y="9" width="75" height="16" alignx="left" aligny="top">
</td>
</tr>
</table>
</body>
</html>